package member

import (
	"parking-lot-go-dingding/controller"
	"parking-lot-go-dingding/model/member"

	"github.com/gin-gonic/gin"
)

func Disable(c *gin.Context) {
	requestStruct := struct {
		Ids []int `json:"ids"`
	}{}

	//接收加密串
	if err := c.ShouldBindJSON(&requestStruct); err != nil {
		controller.Fail(c, "json接收失败"+err.Error())
		return
	}

	var memberStruct member.MemberStruct
	if err := memberStruct.DingTalkDisable(requestStruct.Ids, 2); err != nil {
		controller.Fail(c, "禁用失败"+err.Error())
		return
	}

	controller.Success(c, map[string]interface{}{})
}
